package com.zillion.certificate.service.impl;

import com.zillion.certificate.domain.HealthCertificate;
import com.zillion.certificate.mapper.HealthCertificateMapper;
import com.zillion.certificate.service.IHealthCertificateService;
import com.zillion.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 体检健康证Service业务层处理
 *
 * @author zillion
 * @date 2025-06-16
 */
@Service
public class HealthCertificateServiceImpl implements IHealthCertificateService
{
    @Autowired
    private HealthCertificateMapper healthCertificateMapper;

    /**
     * 查询体检健康证
     *
     * @param id 体检健康证主键
     * @return 体检健康证
     */
    @Override
    public HealthCertificate selectHealthCertificateById(Long id)
    {
        return healthCertificateMapper.selectHealthCertificateById(id);
    }

    /**
     * 查询体检健康证列表
     *
     * @param healthCertificate 体检健康证
     * @return 体检健康证
     */
    @Override
    public List<HealthCertificate> selectHealthCertificateList(HealthCertificate healthCertificate)
    {
        return healthCertificateMapper.selectHealthCertificateList(healthCertificate);
    }

    /**
     * 新增体检健康证
     *
     * @param healthCertificate 体检健康证
     * @return 结果
     */
    @Override
    public int insertHealthCertificate(HealthCertificate healthCertificate)
    {
        healthCertificate.setCreateTime(DateUtils.getNowDate());
        return healthCertificateMapper.insertHealthCertificate(healthCertificate);
    }

    /**
     * 修改体检健康证
     *
     * @param healthCertificate 体检健康证
     * @return 结果
     */
    @Override
    public int updateHealthCertificate(HealthCertificate healthCertificate)
    {
        return healthCertificateMapper.updateHealthCertificate(healthCertificate);
    }

    /**
     * 批量删除体检健康证
     *
     * @param ids 需要删除的体检健康证主键
     * @return 结果
     */
    @Override
    public int deleteHealthCertificateByIds(Long[] ids)
    {
        return healthCertificateMapper.deleteHealthCertificateByIds(ids);
    }

    /**
     * 删除体检健康证信息
     *
     * @param id 体检健康证主键
     * @return 结果
     */
    @Override
    public int deleteHealthCertificateById(Long id)
    {
        return healthCertificateMapper.deleteHealthCertificateById(id);
    }
}
